bitkeeper revision 1.1384 (426d6d66A3AfjqSI_9GpheK5U1rydQ)
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 25 Apr 2005 22:21:26 +0000 (22:21 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 25 Apr 2005 22:21:26 +0000 (22:21 +0000)
Fix xlvbd_device_alloc to memset() allocated memory correctly.
Signed-off-by: Keir Fraser <keir@xensource.com>
linux-2.6.11-xen-sparse/drivers/xen/blkfront/vbd.c

index f8aec6493807a9aa940515cc0ef450ea74d6ea9e..5097c3a8ccc20a4ff8bfcc58f06fbfd532b4029a 100644 (file)
@@ -102,16 +102,16 @@ static struct block_device_operations xlvbd_block_fops =
 
 spinlock_t blkif_io_lock = SPIN_LOCK_UNLOCKED;
 
-static struct lvdisk * xlvbd_device_alloc(void)
+static struct lvdisk *xlvbd_device_alloc(void)
 {
-    struct lvdisk *ret;
+    struct lvdisk *disk;
 
-    ret = kmalloc(sizeof(struct lvdisk), GFP_KERNEL);
-    if ( ret ) {
-        memset(ret, '\0', 0);
-        INIT_LIST_HEAD(&ret->list);
+    disk = kmalloc(sizeof(*disk), GFP_KERNEL);
+    if (disk) {
+        memset(disk, 0, sizeof(*disk));
+        INIT_LIST_HEAD(&disk->list);
     }
-    return ret;
+    return disk;
 }
 
 static void xlvbd_device_free(struct lvdisk *disk)